package examination;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class LexicographicalOrder {
    public static List<Integer> lexicalOrder(int n) {
        List<Integer> list = new ArrayList<>(n);
        int a = 1;
        for (int i = 1; i <= n; i++) {
            list.add(a);
            if (a * 10 <= n) {
                a *= 10;
            } else if (a % 10 != 9 && a + 1 <= n) {
                a++;
            }else {
                while ((a / 10) % 10 == 9) {
                    a /= 10;
                }
                a = a / 10 + 1;
            }
        }
        return list;
    }
    public static void main(String args[]){
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();

        System.out.println(lexicalOrder(num));
    }
}

